<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>流程&优势视频</title>
		<link rel="stylesheet" href="css/upWindow.css" />
		<link rel="stylesheet" href="css/MomPhotoDetail.css" />
		<link rel="stylesheet" href="css/style.css" />
		<link rel="stylesheet" href="css/base.css" />
		<script type="text/javascript" src="bootstrap/js/jquery1.11.3.js"></script>
		<script type="text/javascript" src="js/dom/jquery.js"></script>
		<script type="text/javascript" src="js/register.js"></script>
		<script type="text/javascript" src="js/topPublic.js"></script>
		<script type="text/javascript" src="js/banner.js"></script>
	</head>
	<body>
		<script type="text/javascript" src="js/header.js"></script>
		<div class="banner-img">
			<img src="img/img_02.png" />
		</div>
		<div class="main-part">
			<div class="main-part-left">
				<p class="title" id="video_titel"></p>
				<iframe class="video_content" src="" frameborder=0 allowfullscreen></iframe>

				<!--<div class="add-comments">
					<div class="word-limit">
						<span id="counter" class="span1">0</span>
						<span>/</span>
						<span>300</span>
					</div>
					<textarea maxlength="300" class="mes" id="status" name="status" rows="6" cols="40"  placeholder="看到槽点，不吐不快！别憋着，马上大声说出来吧！"></textarea>
					<span class="addcomm" onclick="publishcomm()">发表评论</span>
					<ul class="all-comments">
						<li class="comm-list no-pad">
							<span class="comm-list-title2 comm-list-title-che" id="one2" onclick="submitcomm(getQueryString('sid'))">全部评论<span class="totalRowNumber totalRowNumber1"></span></span>
							<span class="comm-list-title2" id="two2" onclick="submitmycomm($('#sid').val())">我的评论<span class="totalRowNumber totalRowNumber2"></span></span>
						</li>
						<ul class="all-comments-one" id="all-comments-one2">
							<div class="commbox"></div>
						</ul>
					</ul>
				</div>-->
			</div>
			<div class="main-part-right">
				<p style="width:380px;height:54px;background-color: #EB6100;overflow: hidden;">
					<img style="float: left;margin: 10px 10px 10px 20px;" src="img/hot_05.png" />
					<span style="float:left;color: #ffffff;font-size: 24px;line-height: 54px;">推荐视频</span>
				</p>
				<div class="photo-scroll">
					<ul id="video_list">
						<!--视频列表-->
					</ul>
				</div>
			</div>
		</div>
		<input type="hidden" value="tv" id="navid" />
		<script type="text/javascript" src="js/footer.js"></script>
		<script>
			function getQueryString(name) {
				var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
				var r = window.location.search.substr(1).match(reg); //获取url中"?"符后的字符串并正则匹配
				var context = "";
				if(r != null)
					context = r[2];
				reg = null;
				r = null;
				return context == null || context == "" || context == "undefined" ? "" : context;
			}
//			submitcomm(getQueryString('sid'));

			$(function() {

				$.ajax({
					url: '/baby/process/getProcess', // 跳转到 action  
					data: {
						
					},
					type: 'post',
					cache: false,
					dataType: 'json',
					success: function(data) {
						console.log(data);
						if(data.code == "2000") {
							var str = data.data[0];
							var title = $("#video_titel");
							var vurl = str.videoUrl
							var video = $("iframe.video_content")

							title.append(str.title);
							video.attr('src', vurl);

						} else if(data.code == "5001") {
							alert(data.message);

						}
					},
					error: function() {
						// view("异常！");  
						console.log("异常！");
					}
				});
			})

			$(function() {
				demo();

			});

			function demo(curr) {
				var key = $("#key").val();

				$.ajax({
					url: '/baby/liveVideoShow/queryLiveVideoShow', // 跳转到 action  
					data: {
						pageNum: curr,
						key: key
					},
					type: 'post',
					cache: false,
					dataType: 'json',
					success: function(data) {
						if(data.code == "2000") {

							if(data.data == null) {
								alert("没有找到数据");
								return
							}
							var datalist = data.data.dataList;

							//拼页面

							var htmlstr = '';
							for(var i = 0; i < datalist.length; i++) {
								var obj = datalist[i]; //获取单个数据对象
								//拼页面
								// console.log(obj); 								
								var comurl = "videoDetail.html?sid=" + obj.sid

								htmlstr += '<li class="photo-part">' +
									'<img  src="' + obj.img.realPicUrl + '" />' +
									'<p><a href="'+comurl+'">' + obj.name +'</a></p>'+
									'<span class="icon-comments plnum"> '+obj.commentSum+'</span></li>'

							}
							document.getElementById("video_list").innerHTML = htmlstr
								

						} else if(data.code == "5001") {
							alert(data.message);
							

						}
					},
					error: function() {
						// view("异常！");  
						//alert("异常！");
					}
				});
			};
		</script>
	</body>

</html>